<template>
    <view class="check-box" :class="ggclass">
        <view class="check" @click="ischeck = !ischeck" :style="{ background: ischeck ? color : '' }" :class="{ pitch: ischeck }"> </view>
    </view>
</template>

<script>
export default {
    name: "qg-check",
    props: {
        value: {
            type: Boolean,
            default: false,
        },
        color: {
            type: String,
            default: "#CBA855",
        },
        ggclass: {
            type: String,
            default: "",
        },
    },
    computed: {
        ischeck: {
            get() {
                return this.value;
            },
            set(val) {
                this.$emit("input", val);
            },
        },
    },
};
</script>

<style scoped>
.check-box {
    display: flex;
    align-items: center;
}
.check {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #ccc;
    margin-right: 10px;
}
.pitch {
    border: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pitch::before {
    content: "";
    display: inline-block;
    margin-top: -5px;
    width: 17px;
    height: 7px;
    border-left: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: rotate(-45deg);
}
</style>
